+2002-04-30 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): assign
+ something to "prev" so that removing tag info succeeds.
+ Part of #77301
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_unref): reorder so that it
+ unrefs the tag table first, so that the btree is in a consistent
+ state when we're removing tags from it.
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_remove_buffer): strip
+ all tags in the tag table out of the buffer. #77301
+
Tue Apr 30 11:37:09 2002 Owen Taylor <otaylor@redhat.com>
* modules/input/gtkimcontextxim.c: Make multihead-safe;
+2002-04-30 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): assign
+ something to "prev" so that removing tag info succeeds.
+ Part of #77301
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_unref): reorder so that it
+ unrefs the tag table first, so that the btree is in a consistent
+ state when we're removing tags from it.
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_remove_buffer): strip
+ all tags in the tag table out of the buffer. #77301
+
Tue Apr 30 11:37:09 2002 Owen Taylor <otaylor@redhat.com>
* modules/input/gtkimcontextxim.c: Make multihead-safe;
+2002-04-30 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): assign
+ something to "prev" so that removing tag info succeeds.
+ Part of #77301
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_unref): reorder so that it
+ unrefs the tag table first, so that the btree is in a consistent
+ state when we're removing tags from it.
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_remove_buffer): strip
+ all tags in the tag table out of the buffer. #77301
+
Tue Apr 30 11:37:09 2002 Owen Taylor <otaylor@redhat.com>
* modules/input/gtkimcontextxim.c: Make multihead-safe;
+2002-04-30 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): assign
+ something to "prev" so that removing tag info succeeds.
+ Part of #77301
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_unref): reorder so that it
+ unrefs the tag table first, so that the btree is in a consistent
+ state when we're removing tags from it.
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_remove_buffer): strip
+ all tags in the tag table out of the buffer. #77301
+
Tue Apr 30 11:37:09 2002 Owen Taylor <otaylor@redhat.com>
* modules/input/gtkimcontextxim.c: Make multihead-safe;
+2002-04-30 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): assign
+ something to "prev" so that removing tag info succeeds.
+ Part of #77301
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_unref): reorder so that it
+ unrefs the tag table first, so that the btree is in a consistent
+ state when we're removing tags from it.
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_remove_buffer): strip
+ all tags in the tag table out of the buffer. #77301
+
Tue Apr 30 11:37:09 2002 Owen Taylor <otaylor@redhat.com>
* modules/input/gtkimcontextxim.c: Make multihead-safe;
+2002-04-30 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): assign
+ something to "prev" so that removing tag info succeeds.
+ Part of #77301
+
+ * gtk/gtktextbtree.c (_gtk_text_btree_unref): reorder so that it
+ unrefs the tag table first, so that the btree is in a consistent
+ state when we're removing tags from it.
+
+ * gtk/gtktexttagtable.c (_gtk_text_tag_table_remove_buffer): strip
+ all tags in the tag table out of the buffer. #77301
+
Tue Apr 30 11:37:09 2002 Owen Taylor <otaylor@redhat.com>
* modules/input/gtkimcontextxim.c: Make multihead-safe;
tree->refcount -= 1;
if (tree->refcount == 0)
- {
- gtk_text_btree_node_destroy (tree, tree->root_node);
+ {
+ g_signal_handler_disconnect (G_OBJECT (tree->table),
+ tree->tag_changed_handler);
+ g_object_unref (G_OBJECT (tree->table));
+ tree->table = NULL;
+
+ gtk_text_btree_node_destroy (tree, tree->root_node);
+ tree->root_node = NULL;
+
g_assert (g_hash_table_size (tree->mark_table) == 0);
g_hash_table_destroy (tree->mark_table);
-
+ tree->mark_table = NULL;
+
g_object_unref (G_OBJECT (tree->insert_mark));
+ tree->insert_mark = NULL;
g_object_unref (G_OBJECT (tree->selection_bound_mark));
-
- g_signal_handler_disconnect (G_OBJECT (tree->table),
- tree->tag_changed_handler);
-
- g_object_unref (G_OBJECT (tree->table));
+ tree->selection_bound_mark = NULL;
g_free (tree);
}
g_assert (seg != NULL);
g_assert (indexable_seg != NULL);
g_assert (seg != indexable_seg);
-
+
if ( (seg->type == >k_text_toggle_on_type ||
seg->type == >k_text_toggle_off_type) &&
(seg->body.toggle.info == info) )
info->toggle_count = 0;
tree->tag_infos = g_slist_prepend (tree->tag_infos, info);
+
+#if 0
+ g_print ("Created tag info %p for tag %s(%p)\n",
+ info, info->tag->name ? info->tag->name : "anon",
+ info->tag);
+#endif
}
return info;
info = list->data;
if (info->tag == tag)
{
+#if 0
+ g_print ("Removing tag info %p for tag %s(%p)\n",
+ info, info->tag->name ? info->tag->name : "anon",
+ info->tag);
+#endif
+
if (prev != NULL)
{
prev->next = list->next;
return;
}
+ prev = list;
list = g_slist_next (list);
}
}
GtkTextTagTable *table;
table = GTK_TEXT_TAG_TABLE (object);
-
+
gtk_text_tag_table_foreach (table, foreach_unref, NULL);
g_hash_table_destroy (table->hash);
table->buffers = g_slist_prepend (table->buffers, buffer);
}
+static void
+foreach_remove_tag (GtkTextTag *tag, gpointer data)
+{
+ GtkTextBuffer *buffer;
+
+ buffer = GTK_TEXT_BUFFER (data);
+
+ _gtk_text_buffer_notify_will_remove_tag (buffer, tag);
+}
+
void
_gtk_text_tag_table_remove_buffer (GtkTextTagTable *table,
gpointer buffer)
{
g_return_if_fail (GTK_IS_TEXT_TAG_TABLE (table));
+ gtk_text_tag_table_foreach (table, foreach_remove_tag, buffer);
+
table->buffers = g_slist_remove (table->buffers, buffer);
}